﻿



class PetsServerApi extends ServerApi
{
	private static inline var serverURL : String = "http://localhost/index.php";
	private static inline var authKey : String = "";
	private static inline var appName : String = "";
	
	
	public function new(viewerId : Int) 
	{
		super(serverURL, authKey, viewerId, appName);
	}
	
	public function addPet(owner:String,species:String,name:String)
	{
		var params = {
			method: "add"
		};
		
		var onComplete = function(xml : Xml) {
			trace("bbb");
			//var parser = new ChannelXmlParser(xml);
			//onLoad(parser.parse());
		};
		
		this.request("", params, onComplete, onError);
	}
	
public function PetsList()
{
	var params = {
		method: "list"
	};
	
	var onCompleteList = function(xml : Xml) {
		trace("aaa");
		//var parser = new ItemXmlParser(xml);
		//onLoad(parser.parse());
	};
	
	this.request("", params, onCompleteList, onError);
}

	private function onError(s : String) : Void
	{
		trace(s);
	}
	
}